feat:Add Java and Kotlin code examples to realtime and transcription endpoints#187
feat:Add Java and Kotlin code examples to realtime and transcription endpoints#187
Conversation
WalkthroughThe OpenAPI specification file was updated to include Java and Kotlin example code snippets for realtime and transcription session endpoints. These additions demonstrate how to use the OpenAI client in Java and Kotlin for creating sessions. No modifications were made to response schemas, endpoint behaviors, or public entity declarations. Changes
Poem
✨ Finishing Touches🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (2)
src/libs/tryAGI.OpenAI/openapi.yaml (2)
5030-5031: Remove or make use ofSessionCreateParams/TranscriptionSessionCreateParamsimports in the example snippetsBoth the Java and Kotlin examples import
SessionCreateParams, yet the variable is never referenced; the code immediately callsclient.beta().realtime().sessions().create()with no arguments.
This creates two minor problems:
- Beginners copy-pasting the snippet will get “unused import” warnings from their IDE/compiler.
- The snippet doesn’t show how to supply the same parameters that the preceding cURL example demonstrates (
model,modalities,instructions, …), reducing the educational value.Either delete the unused import lines, or (preferred) show a minimal parameter object being built and passed, e.g.
SessionCreateParams params = SessionCreateParams.builder() .model("gpt-4o-realtime-preview") .modalities(Arrays.asList("audio", "text")) .instructions("You are a friendly assistant.") .build(); SessionCreateResponse session = client.beta().realtime().sessions().create(params);Doing the same for the Kotlin example keeps the docs consistent and warning-free.
5062-5063: Same issue for the Transcription-session examples
TranscriptionSessionCreateParamsis imported but unused in both Java and Kotlin snippets.
Apply the same clean-up or, better, illustrate building the parameter object so the sample mirrors the cURL call.TranscriptionSessionCreateParams params = TranscriptionSessionCreateParams.builder().build(); // fill in when options exist TranscriptionSession session = client.beta().realtime().transcriptionSessions().create(params);This keeps the examples warning-free and pedagogically complete.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
src/libs/tryAGI.OpenAI/openapi.yaml(2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: Test / Build, test and publish
Summary by CodeRabbit